<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      function Hero(uname, type, blood) {
        this.name = uname
        this.type = type
        this.blood = blood
        this.attack = function (t) {
          console.log(t)
        }
      }
      var lianpo = new Hero('廉颇', '力量型', '500血量')
      lianpo.attack('近战')
      console.log(lianpo)
      var houyi = new Hero('后羿', '射手型', '100血量')
    </script>
  </body>
</html>
